﻿using System;

namespace GuidanceExplorerAddIn
{
    public static class IServiceProviderExtensions
    {
        public static T GetService<T>(this IServiceProvider serviceProvider) where T:class
        {
            return serviceProvider.GetService(typeof(T)) as T;
        }

        public static K GetService<T, K>(this IServiceProvider serviceProvider) where K:class
        {
            return serviceProvider.GetService(typeof(T)) as K;
        }
    }
}
